package com.lh.dao;

import com.lh.entity.Image;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * @Author: LuoHang
 * @Date: 2023/2/20 20:52
 * @Description
 */
@Repository
public class ImageDao {
    @Autowired
    private SqlSessionTemplate sessionTemplate;

    public int upload(Image image){
        return sessionTemplate.insert("ImageMapper.upload",image);
    }

    public List<Image> getImagesByMap(Map<String,Integer> map){
        return sessionTemplate.selectList("ImageMapper.getImagesByMap",map);
    }

    public int updateImgByMap(Map<String,Object> map){
        return sessionTemplate.update("ImageMapper.updateImgByMap",map);
    }
}
